home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: ** Disabling ctrl-C in C **
- Date: Sat, 16 Mar 96 00:18:20 GMT
- Organization: none
- Message-ID: <826935500snz@genesis.demon.co.uk>
- References: <4hpbv3$6u@maltese.eag.unisysgsg.com> <31435190.45C2@post.drexel.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!genesis.demon.co.uk
-
- In article <31435190.45C2@post.drexel.edu>
- st94e485@post.drexel.edu "Sean P Kelly" writes:
-
- ...
-
- >#include <termio.h>
- >
- > struct termio term_init;
- > struct termio termnew;
- >
- >ioctl(0, TCGETA, &term_init); /*stores initial terminal conditions*/
- >
- >termnew = term_init;
- >termnew.c_lflag &= ~ISIG;
- >
- >ioctl (0,TCSETAF, &termnew); /*terminal now ignores signals*/
- >
- >if (ioctl (0,TCSETAF,&term_init); /*sets terminal back to initial conditions*/
-
- That seems an excessively long-winded and non-portable way of writing:
-
- #include <signal.h>
-
- signal(SIGINT, SIG_IGN);
-
- :-)
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-